
#################################################################
#
#				Warninng!!!!
#				============
#	
# this make file compile all the sources with implicit rules
# therfore in order to make sure all the changes were made 
# run it with "make clean all"
#
##################################################################


# list of all the sources files
SRCS	= osm.c \


# compiler 
CC	= gcc

# in order to run in debug mode use the command "make DBG=1"
ifdef DBG

	CFLAGS = \
		-Wall 	\
		-Werror \
		-DDEBUG	\
		-O0			
					
						
else
	CFLAGS = \
		-Wall		\
		-DNDEBUG    \
		-O0	
				 
endif


# linker
LD	= $(CC)
LDFLAGS	=


# the name of the lib to create 
DIST_LIB = libosm.a

# each lib should add with -l flag
LIBS = 


# rule to change the suffix of the sources files
OBJS	= ${SRCS:.c=.o}

# clear out all suffixes
.SUFFIXES:
# list only those we use
.SUFFIXES: .o .c

# define a suffix rule for .c -> .o
.c.o :
	$(CC) $(CFLAGS) -c $<

##################################
# 	default target 		##
##################################
all : $(DIST_LIB)

$(DIST_LIB) : $(OBJS)
	ar rcu $(DIST_LIB) $(OBJS)
	ranlib $(DIST_LIB)

$(OBJS) : $(SRCS)

.PHONY:
clean :
	rm -f $(DIST_LIB) $(OBJS)
